﻿using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Sustainalytics.ClientDW.Entities;
using Sustainalytics.ScreeningTool.Synchronization.Handlers;
using Xunit;

namespace Sustainalytics.ScreeningTool.Synchronization.Tests.Handlers.Type7GCOverallCompanySummaryExtendedHandlerTests
{
    [Trait("Category", "Unit")]
    public class JoinStringPrinciples_Should
    {
        [Fact]
        public void return_null_if_principles_sequence_is_null()
            => ((GCPrincipleTemplate[])null).JoinStringPrinciples(";").Should().Be(null);

        [Fact]
        public void return_concatenated_principles_with_description()
        {
            var principles = new GCPrincipleTemplate[]
            {
                new GCPrincipleTemplate { Id = 1, Description = "description 1" },
                new GCPrincipleTemplate { Id = 2, Description = "description 2" },
            };

            var expected = "Principle 1: description 1;Principle 2: description 2";

            principles.JoinStringPrinciples(";").Should().Be(expected);
        }
    }
}
